package com.seedwill.common.meta.schema;
/**
 * @author kdyi
 *
 */
public class FieldMetaInfo implements java.io.Serializable  {
	
//    String colNames[] = {1"TABLE_CAT",           2"TABLE_SCHEM",
//  3"TABLE_NAME",          4"COLUMN_NAME",
//  5"DATA_TYPE",           6"TYPE_NAME",
//  7"COLUMN_SIZE",         8"BUFFER_LENGTH",
//  9"DECIMAL_DIGITS",      10"NUM_PREC_RADIX",
//  11"NULLABLE",            12"REMARKS",
//  13"COLUMN_DEF",          14"SQL_DATA_TYPE",
//  15"SQL_DATETIME_SUB",    16"CHAR_OCTET_LENGTH",
//  17"ORDINAL_POSITION",    18"IS_NULLABLE",
//  19"SCOPE_CATALOG",       20"SCOPE_SCHEMA",
//  21"SCOPE_TABLE",         22"SOURCE_DATA_TYPE"};		
	
//int colTypes[]     = {Types.VARCHAR,         Types.VARCHAR,
//     Types.VARCHAR,         Types.VARCHAR,
//     Types.INTEGER,         Types.VARCHAR,
//     Types.INTEGER,         Types.INTEGER,
//     Types.INTEGER,         Types.INTEGER,
//     Types.INTEGER,         Types.VARCHAR,
//     Types.VARCHAR,         Types.INTEGER,
//     Types.INTEGER,         Types.INTEGER,
//     Types.INTEGER,         Types.VARCHAR,
//     Types.VARCHAR,         Types.VARCHAR,
//     Types.VARCHAR,         Types.SMALLINT};	
	
	
//    new String[] {
//    		+                "TABLE_CAT", "TABLE_SCHEM", "TABLE_NAME", "COLUMN_NAME",
//    		+                "DATA_TYPE", "TYPE_NAME", "COLUMN_SIZE", "BUFFER_LENGTH",
//    		+                "DECIMAL_DIGITS", "NUM_PREC_RADIX", "NULLABLE", "REMARKS",
//    		+                "COLUMN_DEF", "SQL_DATA_TYPE", "SQL_DATETIME_SUB", "CHAR_OCTET_LENGTH",
//    		+                "ORDINAL_POSITION", "IS_NULLABLE", "SCOPE_CATLOG", "SCOPE_SCHEMA",
//    		+                "SCOPE_TABLE", "SOURCE_DATA_TYPE", "IS_AUTOINCREMENT"
//    		+               },
//    		+               new int[] {
//    		+               Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Types.VARCHAR,
//    		+               Types.INTEGER, Types.VARCHAR, Types.INTEGER, Types.INTEGER,
//    		+               Types.INTEGER, Types.INTEGER, Types.INTEGER, Types.VARCHAR,
//    		+               Types.VARCHAR, Types.INTEGER, Types.INTEGER, Types.INTEGER,
//    		+               Types.INTEGER, Types.VARCHAR, Types.VARCHAR, Types.VARCHAR,
//    		+               Types.VARCHAR, Types.SMALLINT, Types.VARCHAR
//    		+               }
	
//    * <P>Each column description has the following columns:
//        * <OL>
//        * <LI><B>TABLE_CAT</B> String => table catalog (may be null)
//        * <LI><B>TABLE_SCHEM</B> String => table schema (may be null)
//        * <LI><B>TABLE_NAME</B> String => table name
//        * <LI><B>COLUMN_NAME</B> String => column name
//        * <LI><B>DATA_TYPE</B> short => SQL type from java.sql.Types
//        * <LI><B>TYPE_NAME</B> String => Data source dependent type name
//        * <LI><B>COLUMN_SIZE</B> int => column size. For char or date
//        *  types this is the maximum number of characters, for numeric or
//        *  decimal types this is precision.
//        * <LI><B>BUFFER_LENGTH</B> is not used.
//        * <LI><B>DECIMAL_DIGITS</B> int => the number of fractional digits
//        * <LI><B>NUM_PREC_RADIX</B> int => Radix (typically either 10 or 2)
//        * <LI><B>NULLABLE</B> int => is NULL allowed?
//        *  <UL>
//        *  <LI> columnNoNulls - might not allow NULL values
//        *  <LI> columnNullable - definitely allows NULL values
//        *  <LI> columnNullableUnknown - nullability unknown
//        *  </UL>
//        * <LI><B>REMARKS</B> String => comment describing column (may be null)
//        * <LI><B>COLUMN_DEF</B> String => default value (may be null)
//        * <LI><B>SQL_DATA_TYPE</B> int => unused
//        * <LI><B>SQL_DATETIME_SUB</B> int => unused
//        * <LI><B>CHAR_OCTET_LENGTH</B> int => for char types the
//        *   maximum number of bytes in the column
//        * <LI><B>ORDINAL_POSITION</B> int => index of column in table
//        *  (starting at 1)
//        * <LI><B>IS_NULLABLE</B> String => "NO" means column definitely
//        *  does not allow NULL values; "YES" means the column might
//        *  allow
	private String colName;
	private String colCode;
	//SQL type from java.sql.Types
	private int colDataType;
	//Data source dependent type name
	private String colTypeName;
	//column size. For char or date types this
    //   is the maximum number of characters, for numeric or decimal types this
    //   is precision.
	private int colSize;
	//is not used.
	private int colBufferLength;
	//the number of fractional digits
	private int colDecimalDigits;
	//Radix
	private int colNumPrecRadix;
	//is NULL allowed?
	//   columnNoNulls - might not allow NULL values
	//   columnNullable - definitely allows NULL values
	//   columnNullableUnknown - nullability unknown
	private boolean colNullable;
	//comment describing column (may be null)
	private String colRemarks;
	//default value (may be null)
	private String colDef;
	//unused
	private int colSQLDataType;
	//unused
	private int colSQLDatetimeSub;
	//for char types the maximum number of bytes in the column
	private int colCharOctetLength;
	//index of column in table (starting at 1)
	private int colOrdinalPosition;
	//"NO" means column definitely does not allow NULL values; "YES" means the column might allow NULL values. An empty string means nobody knows.
	private String colIsNullable;
	//source type of a distinct type or user-generated Ref type,SQL type from java.sql.Types (null if DATA_TYPE isn't DISTINCT or user-generated REF)
	private int colSourceDataType;
	//may not support
	private String colIsAutoincrement;
	
//	private short colScale;
//	private boolean colMand;

	private String parentSchemaName;
	
	private Object defaultValue;
	
	public String getColName() {
		return colName;
	}
	public void setColName(String colName) {
		this.colName = colName;
	}
	public String getColCode() {
		return colCode;
	}
	public void setColCode(String colCode) {
		this.colCode = colCode;
	}
	public int getColDataType() {
		return colDataType;
	}
	public void setColDataType(int colJDBCType) {
		this.colDataType = colJDBCType;
	}
	public String getColTypeName() {
		return colTypeName;
	}
	public void setColTypeName(String colSqlType) {
		this.colTypeName = colSqlType;
	}
	public String getColRemarks() {
		return colRemarks;
	}
	public void setColRemarks(String colRemark) {
		this.colRemarks = colRemark;
	}
//	public boolean isColMand() {
//		return colMand;
//	}
//	public void setColMand(boolean colMand) {
//		this.colMand = colMand;
//	}
	public String getParentSchemaName() {
		return parentSchemaName;
	}
	public void setParentSchemaName(String parentSchemaName) {
		this.parentSchemaName = parentSchemaName;
	}
	public int getColSize() {
		return colSize;
	}
	public void setColSize(int colLength) {
		this.colSize = colLength;
	}
//	public short getColScale() {
//		return colScale;
//	}
//	public void setColScale(short colPrecision) {
//		this.colScale = colPrecision;
//	}
	public boolean isColNullable() {
		return colNullable;
	}
	public void setColNullable(boolean colNullable) {
		this.colNullable = colNullable;
	}
	public int getColBufferLength() {
		return colBufferLength;
	}
	public void setColBufferLength(int colBufferLength) {
		this.colBufferLength = colBufferLength;
	}
	public int getColDecimalDigits() {
		return colDecimalDigits;
	}
	public void setColDecimalDigits(int colDecimalDigits) {
		this.colDecimalDigits = colDecimalDigits;
	}
	public int getColNumPrecRadix() {
		return colNumPrecRadix;
	}
	public void setColNumPrecRadix(int colNumPrecRadix) {
		this.colNumPrecRadix = colNumPrecRadix;
	}
	public String getColDef() {
		return colDef;
	}
	public void setColDef(String colDef) {
		this.colDef = colDef;
	}
	public int getColSQLDataType() {
		return colSQLDataType;
	}
	public void setColSQLDataType(int colSQLDataType) {
		this.colSQLDataType = colSQLDataType;
	}
	public int getColSQLDatetimeSub() {
		return colSQLDatetimeSub;
	}
	public void setColSQLDatetimeSub(int colSQLDatetimeSub) {
		this.colSQLDatetimeSub = colSQLDatetimeSub;
	}
	public int getColCharOctetLength() {
		return colCharOctetLength;
	}
	public void setColCharOctetLength(int colCharOctetLength) {
		this.colCharOctetLength = colCharOctetLength;
	}
	public int getColOrdinalPosition() {
		return colOrdinalPosition;
	}
	public void setColOrdinalPosition(int colOrdinalPosition) {
		this.colOrdinalPosition = colOrdinalPosition;
	}
	public String getColIsNullable() {
		return colIsNullable;
	}
	public void setColIsNullable(String colIsNullable) {
		this.colIsNullable = colIsNullable;
	}
	public int getColSourceDataType() {
		return colSourceDataType;
	}
	public void setColSourceDataType(int colSourceDataType) {
		this.colSourceDataType = colSourceDataType;
	}
	public String getColIsAutoincrement() {
		return colIsAutoincrement;
	}
	public void setColIsAutoincrement(String colIsAutoincrement) {
		this.colIsAutoincrement = colIsAutoincrement;
	}
	public Object getDefaultValue() {
		return defaultValue;
	}
	public void setDefaultValue(Object defaultValue) {
		this.defaultValue = defaultValue;
	}
	
}
